<?php
Class Mlogin extends CI_Model {

    function login($username, $password) {
        $this->db->select('id idUsuario, login,password contra,idioma,idCliente,paginaPreferida');
        $this->db->from('usuario');
        $this->db->where('login = ' . "'" . $username . "'");
        $this->db->where('password = ' . "'" . MD5($password) . "'");
        $this->db->where('inactivo = 0');
        $this->db->limit(1);

        $query = $this->db->get();

        if ($query->num_rows() == 1) {
            return $query->result();
        } else {
            return false;
        }
    }

}

?>